import {
  Affix, Alert,
  Anchor,
  Avatar,
  Button,
  Col,
  Divider,
  Drawer,
  Empty,
  Form,
  Input,
  message,
  Modal,
  Row,
  Select,
  Image, BackTop, Space, Radio, Upload
} from 'ant-design-vue';
import * as Icons from "@ant-design/icons-vue";
import "ant-design-vue/dist/antd.less";

export function setupAntd(app) {

  const icons = Icons;
  for (const i in icons) {
    app.component(i, icons[i]);
  }

  app.use(Button)
  app.use(Row)
  app.use(Col)
  app.use(Drawer)
  app.use(Modal)
  app.use(Form)
  app.use(Select)
  app.use(Input)
  app.use(Divider)
  app.use(Empty)
  app.use(Avatar)
  app.use(Anchor)
  app.use(Affix)
  app.use(Alert)
  app.use(Image)
  app.use(BackTop)
  app.use(Radio)
  app.use(Space)
  app.use(Upload)
  // 添加到全局
  app.config.globalProperties.$antIcons = Icons;
  app.config.globalProperties.$message = message;
}

